package com.tc.dto;

import com.fasterxml.jackson.annotation.JsonView;

import javax.validation.constraints.NotBlank;

/**
 * @Auther: tianchao
 * @Date: 2020/6/21 21:32
 * @Description:
 */
public class User {

    public interface UserSimpleView {

    }
    public interface UserDetailView extends UserSimpleView {

    }
    private Long id;
    @NotBlank
    private String username;
    @NotBlank(message = "密码不能为空")
    private String password;
    @JsonView(UserSimpleView.class)
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @JsonView(UserDetailView.class)
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
